package com.common.utils;

//import com.obs.services.ObsClient;
//import com.obs.services.model.PutObjectResult;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;

public class ObsClientUtil {

    static String  endPoint = "obs.cn-south-1.myhuaweicloud.com";
    static String ak = "YTPGIWVNM5R7ZXPXZWPI";
    static String sk = "Hqdfr3aP1NySdpbRr4V54yqGS1FaTrd0yx3rUG11";
    static String buck="yi918";


//    public static ObsClient getObsClient(){
//        // 创建ObsClient实例
//        ObsClient obsClient = new ObsClient(ak, sk, endPoint);
//
//
//        //创建桶
////        obsClient.createBucket("bucketname");
//        //上传对象
////        PutObjectResult putObjectResult = obsClient.
////                putObject("yi918", "objectname",
////                        new ByteArrayInputStream("Hello OBS".getBytes()));
//
////        String objectUrl = putObjectResult.getObjectUrl();
//
//        return obsClient;
//        // 使用访问OBS
//
//        // 关闭obsClient
////        try {
////            obsClient.close();
////        } catch (IOException e) {
////            e.printStackTrace();
////        }
//    }

//    public static void main(String[] args) {
//        ObsClient obsClient = getObsClient();
//        System.out.println("===");
//        PutObjectResult putObjectResult = obsClient.
//                putObject(buck,
//                        "678.jgp", new File("D:\\1.jpg"));
//        try {
//            obsClient.close();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//    }
}
